import * as vscode from 'vscode';
import { customAlphabet } from 'nanoid';

const genId = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 21);

export function createThread() {
    if (vscode.window.activeTextEditor != undefined) {
        const pos = vscode.window.activeTextEditor.selection.active;
        vscode.window.activeTextEditor.edit(editor => {
            editor.insert(pos, `linksaas://comment/${genId()}`);
        });
    }
}